package GBP;

import java.util.*;

/**
 * TestKLFM.java
 * Created: 2006-01-05 23:30
**/

/**
 * This is the main program performing
 * the Graph-Bipartitioning-Problem experiment.
 *
 * @author T.S.Yo
**/

public class TestKLFM{
    public static void main(String[] args){
        // Read in parameters
        System.out.println("Start reading parameters....");
        ReadIni param1 = new ReadIni();
        System.out.println("Parameters OK");
        System.out.println("");

        // Read in graph definition
        GraphDef graph1 = new GraphDef(param1.gFile,param1.nNode);
        System.out.println("Start reading graph definition....");
        graph1.ReadGBP(param1.gFile);
        //System.out.println(graph1);
        System.out.println("Graph definition OK");
        System.out.println("");
        
        // Initialize population (with or without FM)
        Individual[] pop1 = new Individual[param1.popSize];
        for (int i = 0; i < param1.popSize; i++){
            pop1[i] = new Individual(param1.nNode,graph1);
        }
        Individual ind1 = new Individual(param1.nNode,graph1);
        Individual ind2 = new Individual(ind1);
        System.out.println(ind1);
        KLFM fm1 = new KLFM(graph1,ind1);
        ind2 = fm1.runKLFM();
        System.out.println("After FM: "+ind2);
        
        // Start evolving
        //for (int i = 0; i < param1.popSize; i++){
        //    System.out.println(pop1[i]);
        //}
        //Evolution evo = new Evolution();
        //evo.evolveGBP(pop1);
        //for (int i = 0; i < param1.popSize; i++){
        //    System.out.println(pop1[i]);
        //}
    }
}